package com.ruoyi.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 
 * @TableName contract
 */
@TableName(value ="contract")
@Data
public class Contract implements Serializable {
    /**
     * id
     */
    @TableId(type = IdType.AUTO)
    private Integer cid;

    /**
     * 合同标题
     */
    private String headline;

    /**
     * 甲方姓名/放款人
     */
    private String firstparty;

    /**
     * 乙方名称/借款人
     */
    private String secondparty;

    /**
     * 借款金额
     */
    private Long money;

    /**
     * 还款类型
     */
    private Integer rid;

    /**
     * 利率
     */
    private Long interestrate;

    /**
     * 借款时间
     */
    private Date borrowtime;

    /**
     * 还款时长
     */
    private Date returnduration;

    /**
     * 总还款金额
     */
    private Long inallmoney;

    /**
     * 每月还款金额
     */
    private Long monthmoney;

    /**
     * 额外条款
     */
    private String extra;

    /**
     * 甲方身份证号
     */
    private String firstPartyIdentityCard;

    /**
     * 乙方身份证号
     */
    private String secondPartyIdentityCard;

    /**
     * 贷款id
     */
    private Integer lid;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Contract other = (Contract) that;
        return (this.getCid() == null ? other.getCid() == null : this.getCid().equals(other.getCid()))
            && (this.getHeadline() == null ? other.getHeadline() == null : this.getHeadline().equals(other.getHeadline()))
            && (this.getFirstparty() == null ? other.getFirstparty() == null : this.getFirstparty().equals(other.getFirstparty()))
            && (this.getSecondparty() == null ? other.getSecondparty() == null : this.getSecondparty().equals(other.getSecondparty()))
            && (this.getMoney() == null ? other.getMoney() == null : this.getMoney().equals(other.getMoney()))
            && (this.getRid() == null ? other.getRid() == null : this.getRid().equals(other.getRid()))
            && (this.getInterestrate() == null ? other.getInterestrate() == null : this.getInterestrate().equals(other.getInterestrate()))
            && (this.getBorrowtime() == null ? other.getBorrowtime() == null : this.getBorrowtime().equals(other.getBorrowtime()))
            && (this.getReturnduration() == null ? other.getReturnduration() == null : this.getReturnduration().equals(other.getReturnduration()))
            && (this.getInallmoney() == null ? other.getInallmoney() == null : this.getInallmoney().equals(other.getInallmoney()))
            && (this.getMonthmoney() == null ? other.getMonthmoney() == null : this.getMonthmoney().equals(other.getMonthmoney()))
            && (this.getExtra() == null ? other.getExtra() == null : this.getExtra().equals(other.getExtra()))
            && (this.getFirstPartyIdentityCard() == null ? other.getFirstPartyIdentityCard() == null : this.getFirstPartyIdentityCard().equals(other.getFirstPartyIdentityCard()))
            && (this.getSecondPartyIdentityCard() == null ? other.getSecondPartyIdentityCard() == null : this.getSecondPartyIdentityCard().equals(other.getSecondPartyIdentityCard()))
            && (this.getLid() == null ? other.getLid() == null : this.getLid().equals(other.getLid()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getCid() == null) ? 0 : getCid().hashCode());
        result = prime * result + ((getHeadline() == null) ? 0 : getHeadline().hashCode());
        result = prime * result + ((getFirstparty() == null) ? 0 : getFirstparty().hashCode());
        result = prime * result + ((getSecondparty() == null) ? 0 : getSecondparty().hashCode());
        result = prime * result + ((getMoney() == null) ? 0 : getMoney().hashCode());
        result = prime * result + ((getRid() == null) ? 0 : getRid().hashCode());
        result = prime * result + ((getInterestrate() == null) ? 0 : getInterestrate().hashCode());
        result = prime * result + ((getBorrowtime() == null) ? 0 : getBorrowtime().hashCode());
        result = prime * result + ((getReturnduration() == null) ? 0 : getReturnduration().hashCode());
        result = prime * result + ((getInallmoney() == null) ? 0 : getInallmoney().hashCode());
        result = prime * result + ((getMonthmoney() == null) ? 0 : getMonthmoney().hashCode());
        result = prime * result + ((getExtra() == null) ? 0 : getExtra().hashCode());
        result = prime * result + ((getFirstPartyIdentityCard() == null) ? 0 : getFirstPartyIdentityCard().hashCode());
        result = prime * result + ((getSecondPartyIdentityCard() == null) ? 0 : getSecondPartyIdentityCard().hashCode());
        result = prime * result + ((getLid() == null) ? 0 : getLid().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", cid=").append(cid);
        sb.append(", headline=").append(headline);
        sb.append(", firstparty=").append(firstparty);
        sb.append(", secondparty=").append(secondparty);
        sb.append(", money=").append(money);
        sb.append(", rid=").append(rid);
        sb.append(", interestrate=").append(interestrate);
        sb.append(", borrowtime=").append(borrowtime);
        sb.append(", returnduration=").append(returnduration);
        sb.append(", inallmoney=").append(inallmoney);
        sb.append(", monthmoney=").append(monthmoney);
        sb.append(", extra=").append(extra);
        sb.append(", firstPartyIdentityCard=").append(firstPartyIdentityCard);
        sb.append(", secondPartyIdentityCard=").append(secondPartyIdentityCard);
        sb.append(", lid=").append(lid);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}